<template>
  <wd-config-provider :theme="theme" :themeVars="themeVars">
    <slot />
    <wd-toast />
    <wd-message-box />
    <!-- #ifdef MP-WEIXIN -->
    <privacy-popup></privacy-popup>
    <!-- #endif -->
  </wd-config-provider>
</template>
<script lang="ts">
import type { ConfigProviderThemeVars } from 'wot-design-uni'
// #ifdef MP-WEIXIN
import PrivacyPopup from '@/components/PrivacyPopup/index.vue'
// #endif
export default {
  options: {
    addGlobalClass: true,
    virtualHost: true,
    styleIsolation: 'shared',
  },
}
</script>
<script lang="ts" setup>
const themeVars: ConfigProviderThemeVars = {
  // colorTheme: 'red',
  // buttonPrimaryBgColor: '#07c160',
  // buttonPrimaryColor: '#07c160',
}

const theme = ref<string>('light')

const handleThemeChange = (res: any) => {
  theme.value = res.theme
}
</script>
